<?php
namespace Matrix\Controller;

class ReportController extends CommonController {
	
public function __construct() {
		parent::__construct ();
		parent::__config ( array (
				'model_name'=>'Report',
		) );
	}
	
	public function index(){
		if( I ( 'id' )){
			$where_str=array('neq',0);
		}else{
			$where_str=0;
		}
		$this->id=I ( 'id' );
		parent::__config ( array (
				'fuzzy'=>'username',
				'relation' =>true,
				'between_time'=>'created',
				'where_string'=>'agent_id',
				'where_string_value'=>$where_str,
				'statistics'=>array('consume','commission'),//需要统计求和字段
		) );
		$table =I('table');
		if (!$table == null && ! empty ($table)) {
			parent::__config ( array (
					'display' => 'table' ,
					'display_parms'=>array('table'=>1),
			) );
		};
		parent::index ();
	}
	
	function add() {
		parent::add ();
	}
	
	
	function insert() {
		parent::__config ( array (
				'display'=>'index',
		) );
	}
	
	function foreverdelete() {
		
	}
	
	function edit() {
		$data['Report_id']=I('Report_id');
		$data['status']=1;
		D("Report")->save($data);
		$this->redirect("index");
	}
	
	function update() {
		
	}
	
	
	function bean() {
		parent::bean();
	}
	
	function sort() {
		parent::sort ();
	}
	
	function excelImport(){
	}
	
	function excelOutput(){
		
	}
	
}